<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCouponsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
     public function up()
    {
        if(!Schema::HasTable('coupons')){
            Schema::create('coupons', function (Blueprint $table) {
                $table->increments('id');
                $table->integer('sid');
                $table->integer('money')->comment('优惠券金额');
                $table->integer('overdue')->comment('过期时间');
                $table->enum('status',['0','1','2'])->comment('0为已用，1为过期，2为可用')->default('2');
                $table->integer('condi');
                $table->timestamps();
            });
        }
    }
    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        // Schema::drop('coupons');
        
    }
}
